<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
  </head>
  <body>
    <script type="text/javascript">
      // 小明学习js用了7896709887秒。问：共多少天，多少小时，多少分钟，多少秒？
      var allSeconds = 7896709887;

      function convert(totalSeconds) {
        let day = parseInt(totalSeconds / 60 / 60 / 24);
        let hour = parseInt(totalSeconds / 60 / 60 % 24);
        let minute = parseInt(totalSeconds / 60 % 60);
        let second = totalSeconds % 60;
        console.log(`${totalSeconds}秒相当于是${day}天,${hour}小时,${minute}分钟,${second}秒!`);
      }
      
      convert(allSeconds);
    </script>
  </body>
</html>
